#ifndef SYS_CMD_H_
#define SYS_CMD_H_

typedef int fn_cmd_api_t(unsigned char *cmd, int len);

int cmd_get_info(unsigned char *rbuf, int len);
int cmd_dwn_start(unsigned char * rbuf, int len);
int cmd_dwn_file(unsigned char * rbuf, int len);
int cmd_reset(unsigned char * rbuf, int len);
int cmd_sn(unsigned char * rbuf, int len);
int cmd_ped_init(unsigned char * rbuf, int len);
typedef enum {
        CMD_INFO,
        CMD_DWN,
        CMD_DWN_FILE,
        CMD_RESET,
        CMD_USER_INFO,
        CMD_PED_INIT,
        CMD_DWN_SET_SECURITY,
		CMD_DWN_GET_SYS_INFO,
}cmd_type_t;


#define ERR_UNSUPPORTED         0x01
#define ERR_PART_NOT_EXIST      0x02
#define ERR_PART_ERASE_FAILED   0x03
#define ERR_DWN_CON_NOT_MET     0x04
#define ERR_DWN_TOO_LONG        0x05
#define ERR_PART_WRITE_FAILED   0x06
#define ERR_PART_SHA256_FAILED  0x07
#define ERR_PART_TYPE_FAILED    0x08
#define ERR_SIG_FORMAT_FAILED   0x09
#define ERR_OPEN_FILE_FAILED	  0x0a
#define ERR_DATA_LEN_FAILED	0X0b
#define ERR_DWN_OVER            0xFF

#define TEXT_MAX_LEN    (780 * 1024)
#define TEXT_NAME_MAX   12
typedef struct {
        char name[TEXT_NAME_MAX];
        uint32_t length;
        uint8_t sha256[32];
}fileinfo_t;

void sys_cmd_mode(int can_quit);

#endif /* SYS_CMD_H_ */
